package com.java.excend.test_2;

/**
 * @author luzhikun
 * @date 2020/12/5- 21:18
 * <p>
 * 长方形类（子类） 继承了   图形类
 */
public class MyRectangle extends GeometricObject {
    private double weight;
    private double height;

    public MyRectangle() {

    }

    public MyRectangle(double weight, double height) {
        this.weight = weight;
        this.height = height;
    }

    public MyRectangle(String color, double weight, double weight1, double height) {
        super(color, weight);
        this.weight = weight1;
        this.height = height;
    }

    @Override
    public double getWeight() {
        return weight;
    }

    @Override
    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double findArea() {
        return weight * height;
    }
}
